<?php defined('SYSPATH') or die('No direct script access.');
 
class Model_Pages extends ORM {
	protected $_table_name = 'pages';

	public function getOne($postfix, $link) {
		$postfix = Controller_Common::$postfix;

		return DB::select('id', 'link', array('title'.$postfix, 'title'), array('text'.$postfix, 'text'), array('meta_description'.$postfix, 'meta_description'))
			->from($this->_table_name)
			->where('link', '=', $link)
			->as_object()
			->execute()
			->current();
	}

	public function getAbout() {
		$postfix = Controller_Common::$postfix;

		return DB::select('id', 'link', array('title'.$postfix, 'title'), array('text'.$postfix, 'text'), array('meta_description'.$postfix, 'meta_description'))
		->from('pages')
		->where('link', '=', 'about')
		->as_object()
		->execute()
		->current();
	}

}